<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>煤炭管理系统</title>
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/lib/layui/css/layui-theme-custom.css">
    <link rel="stylesheet" href="/static/css/member.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <#include "/base/main-header.ftl">

    <#include "/base/main-left.ftl">
    <div class="layui-body">
        <!-- 内容主体区域  -->
        <div class="site-title">
            <fieldset>
                <legend>
                    <a class="site-title-text">供应商查看</a>
                </legend>

            </fieldset>
        </div>

        <div class="table-box">
            <div class="site-text site-block">
                <form action="" class="layui-form">
                    <div class="layui-form-item">
                        <label for="memberName" class="myLable">供应商名称：</label>
                        <div class="layui-input-block input-search-width layui-inline">
                            <input type="text" name="memberName" required  lay-verify="required" placeholder="请输入供应商名称" autocomplete="off" class="layui-input">
                        </div>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <a href=""><button class="layui-btn layui-btn-radius layui-inline">查询</button></a>
                    </div>

                </form>
            </div>
            <table class="layui-table" lay-size="lg">
                <col width="100px">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>供应商名称</th>
                        <th>组织机构代码</th>
                        <th>法人</th>
                        <th>联系电话</th>
                        <th>注册摘要信息</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                <tr>
                    <td>1</td>
                    <td>黑龙江经贸有限公司</td>
                    <td>85153-9</td>
                    <td>曹冲</td>
                    <td>12345678912</td>
                    <td>通过0家分公司，3家电厂审核，0家列为黑名单</td>
                    <td><a href="/supplierDetails">审核</a></td>
                </tr>
                <tr>
                    <td>2</td>
                    <td>黑龙江经贸有限公司</td>
                    <td>85153-9</td>
                    <td>曹冲</td>
                    <td>12345678912</td>
                    <td>通过0家分公司，0家电厂审核，0家列为黑名单</td>
                    <td><a href="/supplierDetails">审核</a></td>
                </tr>
                </tbody>
            </table>
        </div>
        <br><br><br>

        <div  class="table-box">
            <div class="demoTable">
                搜索ID：
                <div class="layui-inline">
                    <input class="layui-input" name="id" id="demoReload" autocomplete="off">
                </div>
                <button class="layui-btn layui-btn-radius" data-type="reload">搜索</button>
            </div>
            <table class="layui-hide" id="dispSupplier"></table>
        </div>


    </div>
    <#include "/base/main-footer.ftl">
</div>
<script type="text/html" id="option">
    <a href="/{{d.id}}" class="layui-table-link">查看</a>
</script>

<script src="/static/lib/layui/layui.js"></script>
<script>
    layui.use(['layer', 'form', 'element', 'jquery','table'], function () {
        let layer = layui.layer, form = layui.form, $ = layui.$, table = layui.table;

        table.render({
            elem: '#dispSupplier'
            ,url:'/'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {field:'id',title: '序号', sort: true}
                ,{field:'',  title: '供应商名称'}
                ,{field:'',  title: '组织机构代码'}
                ,{field:'',  title: '法人'}
                ,{field:'', title: '联系电话'} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
                ,{field:'', title: '注册摘要信息'}
                ,{field:'', title: '操作',templet: '#option', unresize: true}
            ]]
            ,id: 'testReload'
            ,page: true
        })

        var active = {
            reload: function(){
                var demoReload = $('#demoReload');
                //执行重载
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    ,where: {
                        key: {
                            id: demoReload.val()
                        }
                    }
                }, 'data');
            }
        };

        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });
</script>
</body>
</html>